package br.com.frbb.ugvbr.camera;

import android.content.Context;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback {

	CameraCapturer cameraCapturer;
	
	public CameraPreview(Context context, CameraCapturer cameraCapturer) {
		super(context);
		this.getHolder().addCallback(this);
		this.cameraCapturer = cameraCapturer;
	}

	public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
		
	}

	public void surfaceCreated(SurfaceHolder holder) {
		cameraCapturer.setSurfaceHolder(holder);
	}

	public void surfaceDestroyed(SurfaceHolder holder) {
		cameraCapturer.releaseCamera();
	}

}
